<layout name="popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<div class="popup-header">
		<h1>添加自定义字段</h1>
		<i class="mid"></i>
		<a class="btn btn-normal" onclick="save();">确定</a>
		<a class="btn btn-return" onclick="close_popup();">取消</a>
	</div>
	<div class="popup-body">
		<div class="popup-body-scroll">
			<div class="popup-content">
				<form method='post' id="form_data" >
					<input type="hidden" name="controller" id="controller" value="{$controller}">
					<input type="hidden" name="row_type" id="row_type" value="{$row_type}">
					<input type="hidden" id="opmode" name="opmode" value="add">
					<div class="box">
						<label class="input-label" for="name">名称*：</label>
						<input class="input" type="text" id="name" name="name" check="required" info="请输入名称" >
					</div>
					<div class="box">
						<label class="input-label" for="layout">控件布局：</label>
						<select name="layout" id="layout" check="required" info="请选择控件布局" class="select w16">
							<option value="">请选择 </option>
							<option value="1">一行两列</option>
							<option value="2">一行一列</option>
							<option value="3">占一整行</option>
							<option value="4">由控件控制</option>
						</select>
						<i class="icon"></i>
					</div>
					<div class="box">
						<label class="input-label" for="type">控件类型*：</label>
						<select name="type" id="type" check="required" info="请选择控件类型" class="select w16">
							<option value="">请选择</option>
							<option value="popup">弹窗选择</option>
							<option value="add_file">文件上传</option>
							<option value="text">单行文本</option>
							<option value="date">日期 </option>
							<option value="datetime">日期+时间 </option>
							<option value="select">列表</option>
							<option value="link_select">联动列表</option>
							<option value="radio">单选</option>
							<option value="checkbox">多选 </option>
							<option value="textarea">多行文本 </option>
							<option value="editor">编辑器</option>
							<option value="simple">简易编辑器</option>
							<option value="help">帮助 </option>
							<option value="hr">分隔符</option>
						</select>
						<i class="icon"></i>
					</div>
					<div class="box">
						<label class="input-label" for="data">控件数据：</label>
						<input  class="input" type="text" val="data" name="data" >
					</div>
					<div class="box">
						<label class="input-label" for="config">设置：</label>
						<input  class="input" type="text" id="config" name="config" >
					</div>
					<div class="box">
						<label class="input-label" for="sort">排序：</label>
						<div class="input-block  w10">
							<input class="input" type="text" id="sort" name="sort" >
						</div>
					</div>
					<div class="box">
						<label class="input-label" >验证：</label>
						<select name="validate" id="validate" class="select w10">
							<option value="">请选择 <option value="required">必选 <option value="email">邮件 <option value="number">数字
						</select>
						<i class="icon"></i>
					</div>
					<div class="box">
						<label class="input-label" for="msg">错误提示：</label>
						<input class="input" type="text" id="msg" name="msg" >
					</div>
				</form>
			</div>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);

		layui.use(['global'], function() {
			var $ = layui.jquery;
			var fn = {
				save : function() {
					send_form('form_data', "{:url('save')}", '', function(ret) {
						if (ret.status) {
							layer.msg(ret.info, function() {
								parent.layer.msg(ret.info, {
									time : 1200
								}, function() {									
									parent.location.reload(true);
									parent.layer.close(index);
								});

							});
						} else {
							parent.layer.msg(ret.info);
							return false;
						}
					});
				}
			};
			win_exp(fn);
		});

	</script>
</block>
